package com.story.aistory.controller;


import com.story.aistory.domain.po.Result;
import com.story.aistory.service.IPageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hui
 * @since 2025-03-12
 */
@RestController
@RequestMapping("/page")
@RequiredArgsConstructor
@Tag(name = "story页面相关接口", description = "story页面相关接口")
public class PageController {

    private final IPageService pageService;

    @PostMapping("/uploadPhoto")
    @Operation(summary = "图片上传")
    public Result uploadAvatar(@RequestParam("file") MultipartFile mpFile, @RequestParam("storyId") Integer pageId){
        return pageService.uploadPhoto(mpFile, pageId);
    }

}
